#! /usr/bin/env bash

# 停止并删除原有容器与镜像
docker stop goserver
docker rm goserver
docker rmi goserver:latest

# docker打包新镜像
docker build -t goserver:latest .
# 运行新镜像
docker run --name goserver -d --restart=always --net=host -p 9999:9999 -v /home/server_log:/go/src/gin-vue-admin/log -v /home/uploads:/go/src/gin-vue-admin/uploads goserver:latest